package com.cn.整合.Spring;

import org.apache.xbean.spring.context.ClassPathXmlApplicationContext;
import org.springframework.context.ApplicationContext;
import org.springframework.jms.core.JmsTemplate;

/**
 * @author: dlr
 * @data: 2019/8/20 23:24
 * @desc:Spring整合mq消费者
 */
public class SpringMQ_Consumer {
    public static void main(String[] args) {
        ApplicationContext ctx=new ClassPathXmlApplicationContext("application.xml");

        JmsTemplate jmsTemplate=(JmsTemplate)ctx.getBean("jmsTemplate");

        String res=(String) jmsTemplate.receiveAndConvert();

        System.out.println("消费者消费:"+res);
    }
}
